[clang][FMV] Pass the '+fmv' target-feature when FMV is enabled.#87942
Closed
[clang][FMV] Pass the '+fmv' target-feature when FMV is enabled.#87942
Conversation
This will allow the backend to enable the corresponding subtarget feature (FeatureFMV), which in turn can be queried for llvm codegen decisions. See llvm#87939 for example.
Member
|
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Alexandros Lamprineas (labrinea) ChangesThis will allow the backend to enable the corresponding subtarget feature (FeatureFMV), which in turn can be queried for llvm codegen decisions. See #87939 for example. Full diff: https://github.com/llvm/llvm-project/pull/87942.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 766a9b91e3c0ad..13dbd8ab261d3d 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -7815,13 +7815,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
addOutlineAtomicsArgs(D, getToolChain(), Args, CmdArgs, Triple);
- if (Triple.isAArch64() &&
- (Args.hasArg(options::OPT_mno_fmv) ||
- (Triple.isAndroid() && Triple.isAndroidVersionLT(23)) ||
- getToolChain().GetRuntimeLibType(Args) != ToolChain::RLT_CompilerRT)) {
- // Disable Function Multiversioning on AArch64 target.
+ if (Triple.isAArch64()) {
CmdArgs.push_back("-target-feature");
- CmdArgs.push_back("-fmv");
+ if (Args.hasArg(options::OPT_mno_fmv) ||
+ (Triple.isAndroid() && Triple.isAndroidVersionLT(23)) ||
+ getToolChain().GetRuntimeLibType(Args) != ToolChain::RLT_CompilerRT)
+ CmdArgs.push_back("-fmv");
+ else
+ CmdArgs.push_back("+fmv");
}
if (Args.hasFlag(options::OPT_faddrsig, options::OPT_fno_addrsig,
diff --git a/clang/test/Driver/aarch64-features.c b/clang/test/Driver/aarch64-features.c
index d2075c91314a8b..4f401ea65232f2 100644
--- a/clang/test/Driver/aarch64-features.c
+++ b/clang/test/Driver/aarch64-features.c
@@ -24,6 +24,7 @@
// CHECK-FMV-OFF: "-target-feature" "-fmv"
// CHECK-FMV-NOT: "-target-feature" "-fmv"
+// CHECK-FMV: "-target-feature" "+fmv"
// Check for AArch64 out-of-line atomics default settings.
// RUN: %clang --target=aarch64-linux-android -rtlib=compiler-rt \
|
jroelofs
approved these changes
Apr 8, 2024
Member
Collaborator
Author
Member
|
Makes sense; I was just going through some of the old prs w/ little activity to make sure we haven’t forgotten about them ;Þ |
This was referenced Nov 12, 2024
Collaborator
Author
|
Closing in favor of #116028 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will allow the backend to enable the corresponding subtarget feature (FeatureFMV), which in turn can be queried for llvm codegen decisions. See #87939 for example.